package com.epfresh.supplier.entity;

import java.util.ArrayList;

public class CityMap {
    private int result;
    private ArrayList<CityAddressList> addressList;
    private int newVersion;



    public int getResult() {
        return this.result;
    }

    public void setResult(int result) {
        this.result = result;
    }

    public ArrayList<CityAddressList> getAddressList() {
        return addressList;
    }

    public void setAddressList(ArrayList<CityAddressList> addressList) {
        this.addressList = addressList;
    }

    public int getNewVersion() {
        return this.newVersion;
    }

    public void setNewVersion(int newVersion) {
        this.newVersion = newVersion;
    }



    public static int getIndex(ArrayList<CityAddressList> addressList, String name){
        int index = -1;
        for (int i=0;i<addressList.size();i++){
            CityAddressList cityAddressList = addressList.get(i);
            if (cityAddressList != null && cityAddressList.getName() != null && cityAddressList.getName().equals(name)){
                return i;
            }
        }

        return index;
    }

    @Override
    public String toString() {
        return "City{" +
                "result=" + result +
                ", addressList=" + addressList +
                ", newVersion=" + newVersion +
                '}';
    }
}
